//
//  ACWMainTabBarVC.m
//  aichewang
//
//  Created by rylynn on 16/2/23.
//  Copyright © 2016年 aichewang. All rights reserved.
//

#import "ACWMainTabBarVC.h"
#import "ACWIndexVC.h"
#import "ACWMoreVC.h"
#import "ACWMineVC.h"
#import "ACWInformationVC.h"


@implementation ACWMainTabBarVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initUI];
    
    UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:[[ACWIndexVC alloc] initWithScrollView]];
    nav1.tabBarItem.title = @"首页";
    [self addChildViewController:nav1];
    
    UINavigationController *nav2 = [[UINavigationController alloc] initWithRootViewController:[[ACWMoreVC alloc] initWithScrollView]];
    nav2.tabBarItem.title = @"更多";
    [self addChildViewController:nav2];
    
    UINavigationController *nav3 = [[UINavigationController alloc] initWithRootViewController:[[ACWInformationVC alloc] init]];
    nav3.tabBarItem.title = @"资讯";
    [self addChildViewController:nav3];
    
    UINavigationController *nav4 = [[UINavigationController alloc] initWithRootViewController:[[ACWMineVC alloc] init]];
    nav4.tabBarItem.title = @"我";
    [self addChildViewController:nav4];
}

//更改统一UI样式
- (void)initUI {
    UINavigationBar *bar = [UINavigationBar appearance];
    [bar setBarTintColor:mainRed];
    [bar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [bar setTintColor:[UIColor whiteColor]];
    [self.tabBar setBarTintColor:mainRed];
}

@end
